#include <iostream>
using namespace std;

bool simple (int n) {
     int d = 0;
     for (int i=1; i<=n; i++)
        if (n % i == 0)
            d += 1;
     }
#include <iostream>
#include <string>


using namespace std;
int main()  {
    string digit[] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
    string s, sh, sd, se;
    int h = 0, d = 0, e = 0;
    getline(cin, s);
    sh = s.substr(0, (s.find(' ')));
    sd = s.substr(s.find(' ') + 1, s.rfind(' ') - s.find(' ') - 1);
    se = s.substr((s.rfind(' ') + 1) );




    for (int i=0; i<10;i++) {
        if (sh == digit[i])
            h = i;
        if (se == digit[i])
            d = i;
         if (sd == digit[i])
            e = i;

    }

cout << simple(h * 100 + d * 10 + e);
}
